package com.itheima.dubbo.service;

import com.itheima.dubbo.UserFace;
import org.apache.dubbo.config.annotation.DubboService;
import org.apache.dubbo.config.annotation.Method;
import org.apache.dubbo.rpc.RpcContext;

@DubboService(methods = {
@Method(name="hello",timeout = 1800)
})
public class UserFaceImpl implements UserFace {
    @Override
    public String hello(String userName) {
        System.out.println("肖耀江你好呀");
//        try {
//            Thread.sleep(3000);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
        String xiao = RpcContext.getContext().getAttachment("xiao");
        System.out.println(xiao);
        return "hello Dubbo userName "+userName;
    }
}
